home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
daten
/
astrolog
/
src
/
bugs
< prev
next >
Wrap
Text File
|
1995-08-11
|
7KB
|
188 lines
Dear "Mr. Astrolog" Pullen, (":
I ported Astrolog for Amiga systems and this is a bug report which conatins
all those bugs which I found or which have been reported to me (or at least
most of them, I hope :) However, it also contains my personal suggestions.
I tried to reach you via E-Mail, but all my attempts failed. Mails either
bounced, reached the wrong people or simply got lost somewhere in the depth
of the Internet. I even tried to upload it to ftp.u.washington.edu, but
I had no write permission there. This is why I decided to post my mail into
this group, perhaps starting an RFC for Astrolog ;-)
******************************************************************************
** ASTROLOG BUGS
******************************************************************************
o Some chart types expect certain resulutions which might be too large for
the system display. You handle them [e.g. in "xscreen.c", InteractX()]
like that:
if(gs.xWin > BITMAPX)
gs.xWin = BITMAPX;
However, since clipping is not handled in the turtle stuff, you might
run off the borders nevertheless. [see also "turtle metric" and "compiling
turtles" ideas below].
o Astrolog used to "forget" the former X/Y resolution when switching to
certain chart types, like the world map and aspect grids which must
always be at a certain size. This is however a non-amiga-specific
astrolog problem which has been fixed using a quick hack.
(Bug reported by Robin Reynolds,astarte@solar.sky.net)
Note: The problem occured when switching back to a chart type which does
not depend on a certain resulution (like the chart wheel). In this case
you kept using the new resolution instead of the former one.
o Astrolog's non-deterministic algorithm for symbol collision in a chart
does not do anything if there are three symbols with an exact equal
position. (even if there would be enough room to spread them along the
zodiac)
o In gAstroGraph mode: The Time/Location information is gets printed *over*
the symbols which doesn't look very nice.
o In graphics mode: `-Ky' does not work, but only `-K'.
******************************************************************************
** NON SYSTEM-SPECIFIC MODIFICATIONS
******************************************************************************
o Many compilers return LMT with the time() call which always leads to
problems for the user when he (or she) tries to setup the `-z' and `-z0'
settings in "astrolog.dat". The hint "Set your TZ variable correctly"
often is not of great help since the compiler might not take advantage of
it.
For the Amiga version I introduced an environment variable GMTOFF, which
must be set to the #of seconds which the system clock differs from UT.
This avoids side effects because `-z' and `-z0' can be set to the correct
values. However, the behaviour of GetTimeNow() is a little bit funny:
We compute GMT from LMT via GMTOFF and you make LMT of it again using the
`-z' and `-z0' settings: "Time Zone ping-pong" :-)
o astrolog.h line 1167 & extern.h line 127:
#ifdef PI
#undef PI
#endif /*PI*/
Well, the name "PI" is not a very good choice here... (-:
o astrolog.c: return type of main() changed from `void' to `int'
o data.c:115: initializer element is not constant
FILE *S = stdout; /* initialization moved to main() */
For some compilers (like GNU C), the standard I/O streams are not constant
and thus cannot be use to initialize static or global variables (in the data
section).
o general.c:652: sign = (int)floor(deg / 30.0);
^^^^^
otherwise the degree value `d' might become negative
o general.c:663: d = (int)floor(deg / 15.0);
^^^^^
otherwise the minutes value `m' might become negative
o Take a look at the slightly improved version of NFromPch(). Even if `str'
is accessed only once, we have one less dereference of *str. (-:
******************************************************************************
** IDEAS & SUGGESTIONS
******************************************************************************
o Allow a seperate file for the turtle definitions and perhaps "compiling"
them to a format which is faster to interpret and allows optimisation.
- Numbers are int's and we don't need NFromPch() anymore.
- A metric rectangle can be part of the turtle which allows a quick
descision whether or not this turtle fits into the current display
and we don't need to handle the clipping for every pixel to draw.
o Make Astrolog free of system dependent stuff in #if ... clauses which
only leads to unreadable code. Much better would be a system interface
which allows linking of some X11.o, PCG.o, MAC.o or Amiga.o depending on
the system for which astrolog is to be compiled on. Each of these files
must provide a set of well defined functions and procedures (mainly for
the graphics, but also for future versions which might have a GUI :-).
In order to avoid problems with the function names, there should be an
interface with stub functions which are used by astrolog. If these were
put into a file "machine.c" then we can be sure that this is the *only*
place where the system specific functions are called.
This makes porting Astrolog to other platforms *much* easier.
o I made a Texinfo version of "HELPFILE.440". Texinfo is a HyperText format
which can be converted to PostScript, DVI (TeX), HTML, AmigaGuide, etc.
It would make things much easier if you could maintain and update the
astrolog.texinfo file instead of the helpfile. (-:
Note that you can create an ASCII file from the .texinfo file as well, so
using Texinfo is not a loss, but only a bonus!
******************************************************************************
** GENERAL NOTES
******************************************************************************
+ You used boolean values in integer arithmetics everywhere in the code.
This is somewhat dangerous because (1==1) is only guaranteed to be
something != 0, hence ((1==1)==1) can be false!
Solution: instead of writing
i = 42 + (x==y);
use something like
i = 42 + ( (x==y) ? 1:0 );
+ The readability of large parts in the code could be improved if your
PrintXXX() functions would make use of the varargs mechanism with a
printf()-like format string. Actually each procedure writing some
output needs it's own string buffer (often called sz[]) and contains
several lines which look like that:
sprintf(sz, "foo", bar);
PrintXXX(sz);
I've written some procedures which do that, replacing e.g. the DrawPrint()
function from "xcharts0.c". You might want to have a look at the
xPrintAt() procedure in "xtras.c" which allows writing the above like
that:
xPrint("foo",bar);
The xPrint() functions even allow switching to a different color within
one single call. Example:
xPrint("{green}foo{white}%s\n",bar);
+ In some places, an #else clause after an #ifdef X11 is used instead of
an #ifdef PCG which implies mistakenly that everything which is not X11
must be PCG.
******************************************************************************
Please write to me!
-Tobi
----
Tobias Ferber <ukjg@rz.uni-karlsruhe.de> or <tf@antares.ping.de>